package org.yray.io.gcdemo;

import java.util.ArrayList;
import java.util.List;

/**
 * @author lyg
 * @date 2021/10/10 19:06
 */
public class JConsole {
    static class OOMObject{
        public byte[] place=new byte[64*1024];
    }

    static void fill(int num) throws InterruptedException {
        List<OOMObject> list=new ArrayList<>();
        for(int i=0;i<=num;i++)
        {
            list.add(new OOMObject());
            Thread.sleep(50);
        }
        System.gc();
    }
    public static void main(String[] args) throws InterruptedException {
        fill(1000);

        Thread.sleep(10000);
    }
}
